// 基本配置
// 管理员表结构
const mongoose = require('../config/db')
const bcrypt = require('bcrypt')

const UserSchema = new mongoose.Schema({
    name: {
        type: String,
        required: true
    },
    pass: {
        type: String,
        required: true,
        set(val) {
            return bcrypt.hashSync(val, 10)
        }
    },
    identity: {
        type: String,
        default: '2'
    }
})
module.exports = mongoose.model('User', UserSchema);